package cn.ms.doctor.Mapper;

import cn.ms.doctor.Entity.Prescription;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @Entity cn.ms.doctor.Entity.Prescription
 */
public interface PrescriptionMapper {
    /**
     * 获取指定ID的出诊次数
     * @param userId
     * @return
     */
    public Integer getPrescriptionCountByUserId(@Param("userId") Integer userId);

    /**
     * 获取所有诊断书
     * @param userId
     * @param roleId
     * @param params
     * @return
     */
    @MapKey("prescriptionId")
    List<Map<String, Object>> getPrescriptions(@Param("userId") Integer userId,@Param("roleId") Integer roleId,@Param("params") Map<String, Object> params);

    /**
     * 添加诊断并且返回添加的主键
     * @return
     */
    boolean addPrescription(Prescription prescription);
}




